package servidor;

import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;

public class Server {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		
		try {
			
			String name = "biblioteca";
			Biblioteca objtBiblioteca = new BibliotecaImpl();
			Biblioteca stub = (Biblioteca) UnicastRemoteObject.exportObject(objtBiblioteca, 0);// 0 corresponde a porta default do servidor
			
			Registry registry = LocateRegistry.getRegistry();
			registry.rebind(name, stub);
			
			System.out.println(" Sevidor Biblioteca estah pronto!");
			
		} catch (Exception e) {
			e.printStackTrace();
		}

	}

}
